using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation;

namespace MHI.InspectionManager.Interfaces
{
	/// <summary>
	/// DevSparepartT,table entity:dev_sparepart_t 
	/// </summary>
	public class DevSparepartT
	{
		public static readonly string KeyId;
		public static readonly string KeyName;
		public static readonly string KeyCode;
		public static readonly string KeySparetypeType;
		public static readonly string KeyPrice;
		public static readonly string KeyProductionDate;
		public static readonly string KeyUseDate;
		public static readonly string KeyServiceLife;
		public static readonly string KeyProductionFactory;
		public static readonly string KeyFactoryNumber;
		public static readonly string KeyTechnicalParas;
		public static readonly string KeyRemark;
		public static readonly string KeyGmtCreated;
		public static readonly string KeyPersonModified;
		public static readonly string KeyGmtModified;
		public static readonly string KeyStateInfo;
		public static readonly string KeyIsUse;
		public static readonly string KeyVersion;
		

		static DevSparepartT()
		{
			KeyId = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.Id);
			KeyName = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.Name);
			KeyCode = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.Code);
			KeySparetypeType = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.SparetypeType);
			KeyPrice = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.Price);
			KeyProductionDate = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.ProductionDate);
			KeyUseDate = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.UseDate);
			KeyServiceLife = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.ServiceLife);
			KeyProductionFactory = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.ProductionFactory);
			KeyFactoryNumber = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.FactoryNumber);
			KeyTechnicalParas = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.TechnicalParas);
			KeyRemark = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.Remark);
			KeyGmtCreated = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.GmtCreated);
			KeyPersonModified = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.PersonModified);
			KeyGmtModified = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.GmtModified);
			KeyStateInfo = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.StateInfo);
			KeyIsUse = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.IsUse);
			KeyVersion = ExpressionHelper.GetPropertyName<DevSparepartT>(r => r.Version);
		}
		

		private long _id; 
		private string _name; 
		private string _code; 
		private string _sparetypeType; 
		private decimal _price; 
		private DateTime? _productionDate; 
		private DateTime? _useDate; 
		private int? _serviceLife; 
		private string _productionFactory; 
		private string _factoryNumber; 
		private string _technicalParas; 
		private string _remark; 
		private DateTime? _gmtCreated; 
		private string _personModified; 
		private DateTime? _gmtModified; 
		private float? _stateInfo; 
		private int _isUse; 
		private long _version; 
		

		/// <summary>
		///  Id, column: id required
		/// </summary>
		[DisplayName("编码")]
		[Required]
		public long Id
		{
			get{ return _id; }
			set
			{
				if(_id != value)
				{
					_id = value;
					NotifyOfChange(KeyId);
				}
			}
		}

		/// <summary>
		///  Name, column: name 
		/// </summary>
		[DisplayName("名称")]
		public string Name
		{
			get{ return _name; }
			set
			{
				if(_name != value)
				{
					_name = value;
					NotifyOfChange(KeyName);
				}
			}
		}

		/// <summary>
		///  Code, column: code 
		/// </summary>
		[DisplayName("编号")]
		public string Code
		{
			get{ return _code; }
			set
			{
				if(_code != value)
				{
					_code = value;
					NotifyOfChange(KeyCode);
				}
			}
		}

		/// <summary>
		///  SparetypeType, column: sparetype_type 
		/// </summary>
		[DisplayName("备件类型")]
		public string SparetypeType
		{
			get{ return _sparetypeType; }
			set
			{
				if(_sparetypeType != value)
				{
					_sparetypeType = value;
					NotifyOfChange(KeySparetypeType);
				}
			}
		}

		/// <summary>
		///  Price, column: price 
		/// </summary>
		[DisplayName("单价")]
		[Required]
		public decimal Price
		{
			get{ return _price; }
			set
			{
				if(_price != value)
				{
					_price = value;
					NotifyOfChange(KeyPrice);
				}
			}
		}

		/// <summary>
		///  ProductionDate, column: production_date 
		/// </summary>
		[DisplayName("生产日期")]
		public DateTime? ProductionDate
		{
			get{ return _productionDate; }
			set
			{
				if(_productionDate != value)
				{
					_productionDate = value;
					NotifyOfChange(KeyProductionDate);
				}
			}
		}

		/// <summary>
		///  UseDate, column: use_date 
		/// </summary>
		[DisplayName("启用日期")]
		public DateTime? UseDate
		{
			get{ return _useDate; }
			set
			{
				if(_useDate != value)
				{
					_useDate = value;
					NotifyOfChange(KeyUseDate);
				}
			}
		}

		/// <summary>
		///  ServiceLife, column: service_life 
		/// </summary>
		[DisplayName("使用年限")]
		public int? ServiceLife
		{
			get{ return _serviceLife; }
			set
			{
				if(_serviceLife != value)
				{
					_serviceLife = value;
					NotifyOfChange(KeyServiceLife);
				}
			}
		}

		/// <summary>
		///  ProductionFactory, column: production_factory 
		/// </summary>
		[DisplayName("生产厂家")]
		public string ProductionFactory
		{
			get{ return _productionFactory; }
			set
			{
				if(_productionFactory != value)
				{
					_productionFactory = value;
					NotifyOfChange(KeyProductionFactory);
				}
			}
		}

		/// <summary>
		///  FactoryNumber, column: factory_number 
		/// </summary>
		[DisplayName("出厂编号")]
		public string FactoryNumber
		{
			get{ return _factoryNumber; }
			set
			{
				if(_factoryNumber != value)
				{
					_factoryNumber = value;
					NotifyOfChange(KeyFactoryNumber);
				}
			}
		}

		/// <summary>
		///  TechnicalParas, column: technical_paras 
		/// </summary>
		[DisplayName("技术参数")]
		public string TechnicalParas
		{
			get{ return _technicalParas; }
			set
			{
				if(_technicalParas != value)
				{
					_technicalParas = value;
					NotifyOfChange(KeyTechnicalParas);
				}
			}
		}

		/// <summary>
		///  Remark, column: remark 
		/// </summary>
		[DisplayName("备注")]
		public string Remark
		{
			get{ return _remark; }
			set
			{
				if(_remark != value)
				{
					_remark = value;
					NotifyOfChange(KeyRemark);
				}
			}
		}

		/// <summary>
		///  GmtCreated, column: gmt_created 
		/// </summary>
		[DisplayName("创建时间")]
		public DateTime? GmtCreated
		{
			get{ return _gmtCreated; }
			set
			{
				if(_gmtCreated != value)
				{
					_gmtCreated = value;
					NotifyOfChange(KeyGmtCreated);
				}
			}
		}

		/// <summary>
		///  PersonModified, column: person_modified 
		/// </summary>
		[DisplayName("更新人")]
		public string PersonModified
		{
			get{ return _personModified; }
			set
			{
				if(_personModified != value)
				{
					_personModified = value;
					NotifyOfChange(KeyPersonModified);
				}
			}
		}

		/// <summary>
		///  GmtModified, column: gmt_modified 
		/// </summary>
		[DisplayName("更新时间")]
		public DateTime? GmtModified
		{
			get{ return _gmtModified; }
			set
			{
				if(_gmtModified != value)
				{
					_gmtModified = value;
					NotifyOfChange(KeyGmtModified);
				}
			}
		}

		/// <summary>
		///  StateInfo, column: state_info 
		/// </summary>
		[DisplayName("标识状态")]
		public float? StateInfo
		{
			get{ return _stateInfo; }
			set
			{
				if(_stateInfo != value)
				{
					_stateInfo = value;
					NotifyOfChange(KeyStateInfo);
				}
			}
		}

		/// <summary>
		///  IsUse, column: is_use 
		/// </summary>
		[DisplayName("是否可用")]
		[Required]
		public int IsUse
		{
			get{ return _isUse; }
			set
			{
				if(_isUse != value)
				{
					_isUse = value;
					NotifyOfChange(KeyIsUse);
				}
			}
		}

		/// <summary>
		///  Version, column: version 
		/// </summary>
		[DisplayName("版本")]
		[Required]
		public long Version
		{
			get{ return _version; }
			set
			{
				if(_version != value)
				{
					_version = value;
					NotifyOfChange(KeyVersion);
				}
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		private void NotifyOfChange(string propertyName)
		{
			if (this.PropertyChanged != null)
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
